package cn.b.sky.user.service.model;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息类
 * 
 * @author Admin
 * 
 */
public class Token implements Serializable {
  
  private static final long serialVersionUID = 1L;

  private String token; // Token

  private String siteCode; // 工厂编号

  private String userCode; // 用户编号

  private String ipAddress; // IP地址

  private Date lastAccessDateTime; // 最后访问时间

  private String languageCode; // 语言代码

  private String timeZoneCode; // 时区代码

  //private int TIME_OUT_MINUTES = 30;

  public boolean isTimeOut() {
    if (null == this.getLastAccessDateTime()) {
      return false;
    }
    return (new Date().getTime() - this.getLastAccessDateTime().getTime()) > 30 * 60000;

  }

  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

  public String getSiteCode() {
    return siteCode;
  }

  public void setSiteCode(String siteCode) {
    this.siteCode = siteCode;
  }

  public String getUserCode() {
    return userCode;
  }

  public void setUserCode(String userCode) {
    this.userCode = userCode;
  }

  public String getIpAddress() {
    return ipAddress;
  }

  public void setIpAddress(String ipAddress) {
    this.ipAddress = ipAddress;
  }

  public Date getLastAccessDateTime() {
    return lastAccessDateTime;
  }

  public void setLastAccessDateTime(Date lastAccessDateTime) {
    this.lastAccessDateTime = lastAccessDateTime;
  }

  public String getLanguageCode() {
    return languageCode;
  }

  public void setLanguageCode(String languageCode) {
    this.languageCode = languageCode;
  }

  public String getTimeZoneCode() {
    return timeZoneCode;
  }

  public void setTimeZoneCode(String timeZoneCode) {
    this.timeZoneCode = timeZoneCode;
  }

}
